import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [{
        path: '/',
        name: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'home',
        component: () =>
            import ('../views/Home.vue'),
        meta: { index: 1 }
    },
    {
        path: '/shop',
        name: 'shop',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Shop.vue'),
        meta: { index: 2 }
    },
    {
        path: '/member',
        name: 'member',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Member.vue'),
        meta: { index: 3 }
    },

    {
        path: '/center',
        name: 'person_center',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/PersonCenter.vue'),
        meta: { index: 4 },


    },
    {
        path: '/person_page',
        name: 'PersonPage',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Mine/PersonPage.vue'),

    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router